<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html><html lang="en">
	<head>
		<!--加载header文件-->
		<?php
		include_once 'public/views/header.php';
		include_once 'public/home/html/alert.php';
		?>
		<?php 
		include_once 'public/home/html/select.php';
		?>
		<link rel="stylesheet" href="public/css/list.css" />
		<link rel="stylesheet" href="public/xr/xrDatatable.css" />
		<script src="public/xr/xrDatatable.js"></script>
		<script src="public/js/list.js"></script>
		<script src="public/home/js/function.js"></script>		
		<style>
			.content{
				margin-left: 10%;
				margin-top:5%;
			}
			.item{
				margin-top: 3%
			}

		</style>
	</head>
	<body>
		<input type="hidden" id="url" value="<?php base_url() ?>">
		<input type="hidden" id='start_time' value="<?php echo $start_time;?>">
		<input type="hidden" id='end_time' value="<?php echo $end_time;?>">
		<input type="hidden" id='dept_id' value="<?php echo $dept_id;?>">
		<!-- <div class='content'>
			<?php if($data['data']):?>
			<div><h3>教学督导专题调研报表【<?php echo $data['start_time'].'至'.$data['end_time']; ?>】</h3></div>
			<div><h4><?php if($data['dept_name']!='')echo '【'.$data['dept_name'].'】'; ?></h4></div>			
			<div>
				<?php 
				foreach ($data['data'] as $k => $v) {
					echo "<div class='item'>【".$v['time']."】<br>";
					foreach ($v['data'] as $k1 => $v1) {
						$num=$k1+1;
						echo $num.'.'.'【'.$v1['title'].'】【'.$v1['content'].'】【'.$v1['advice'].'】<br>';
					}
					echo "</div>";
				}				

				 ?>				
			</div>
		<?php else: ?>
			<h3>没有查询到数据</h3>
		<?php endif ?>
		</div> -->
	</body>
	<script>
		$(function(){
			addDialogButton("导出",Export);
		})
		var Export=function(){				
			var start_time=$("#start_time").val();
			var end_time=$('#end_time').val();
			var dept_id=$('#dept_id').val();		
			var msg = "请确认是否导出?";
		    swal({
		        title: "请确认",
		        text: msg,
		        type: "warning",
		        showCancelButton: true,
		        closeOnConfirm: true,
		        confirmButtonText: "确定",
		        cancelButtonText: '取消',
		        confirmButtonColor: "#ec6c62"
		    }, function(isConfirm) {
		        if(isConfirm) {
		            var load_alert=loadAlert('数据导出中，请稍后...');
		            $.ajax({
		                type: "post",
		                url: "Admin/StatisticsTable1/Export/"+dept_id+"/"+start_time+"/"+end_time+"/1",
		                async: true,
		                dataType:'json',
		                success: function(data) {
		                    closeAlert(load_alert);
		                    if(data.status) {
		                        location.href=getRootPath()+'/'+data.v;
		                    } else {
		                        window.parent.topMessagePrompt('error',ret.msg);
		                    }
		                }
		            });
		        }
		    });
		}
	</script>
</html>